package com.cn.wanxi.test;

public class SumJiShu {
    public static void main(String[] args) {
        /**
         * while
         * 1.定义变量初始化  i=1
         * 2.条件判断语句  小于100
         * 3.定义和sum
         * 4.打印和  sum+=i;
         * 5.条件控制语句 i+=2;
         */
        int i = 1;
        int sum = 0;
        while (i <= 100) {
            sum += i;
            i += 2;
        }
        System.out.println("和为:" + sum);
    }
}
